home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / Core / include / gworld.h < prev    next >
Encoding:
Text File  |  1995-04-05  |  2.5 KB  |  46 lines  |  [TEXT/MMCC]

  1. //------------------------------------------------------------------------------
  2. //    File:                    gworld.h
  3. //    Date:                    8/23/94
  4. //    Author:                Bretton Wade
  5. //
  6. //    Description:    this file contains the class definition for a gworld widget.
  7. //
  8. //------------------------------------------------------------------------------
  9.  
  10. #include     "window.h"
  11.  
  12. #ifndef    GWORLD
  13. #define    GWORLD
  14.  
  15. //------------------------------------------------------------------------------
  16. //    enumerations
  17. //------------------------------------------------------------------------------
  18. enum        gw_erase {DONT_ERASE = 0, ERASE = 1};                                                                        //    type flag to tell the gworld to erase the buffer or not when drawing starts
  19. enum        gw_update {DONT_UPDATE = 0, UPDATE = 1};                                                                //    type flag to tell the gworld to update the window or not when drawing stops
  20.  
  21. //------------------------------------------------------------------------------
  22. //    classes
  23. //------------------------------------------------------------------------------
  24. class    gworld : public widget                                                                                                        //    gworld widget class
  25. {                                                                                                                                                                //    begin
  26.     private:                                                                                                                                            //    members internal to this class only
  27.     protected:                                                                                                                                        //    members internal to this class hierarchy
  28.                 GWorldPtr            world;                                                                                                        //    the gworld
  29.                 PixMapHandle    pixmap;                                                                                                        //    handle to the pixels of the gworld
  30.                 GrafPtr                owner;                                                                                                        //    the port of the window using the offscreen buffer
  31.                 GDHandle            curworld;                                                                                                    //    storage for the world in use when drawing begins
  32.                 CGrafPtr            curport;                                                                                                    //    storage for the port in use when drawing begins
  33.     public:                                                                                                                                                //    members available externally
  34.                 gworld (window*);                                                                                                                //    constructor
  35. virtual    ~gworld (void);                                                                                                                    //    destructor
  36. virtual    void        SetCursor (void);                                                                                                //    set the cursor to the correct shape
  37. virtual    void        Resize (EventRecord&);                                                                                    //    recompute sizing information from parent
  38. virtual    void        StartDrawing (gw_erase = ERASE);                                                                //    lock down the gworld and set the port appropriately
  39. virtual    void        StopDrawing (gw_update = UPDATE);                                                                //    unlock the gworld and reset the port
  40. virtual    void        Draw (void);                                                                                                        //    draw the widget
  41. };                                                                                                                                                            //    end
  42.  
  43. //------------------------------------------------------------------------------
  44.  
  45. #endif    //GWORLD
  46.